package cc.vv.btpartyjob.jobactivities.adapter

import android.widget.ImageView
import android.widget.TextView
import cc.vv.baselibrary.adapter.SimpleCommonAdapter
import cc.vv.baselibrary.adapter.holder.ExtendViewHolder
import cc.vv.btpartyjob.jnimodule.server.OperationServer
import cc.vv.btpartyjob.jobactivities.R
import cc.vv.btpartyjob.jobactivities.moudel.bean.ZhiBuActivitiesBean
import cc.vv.lkimagecomponent2.LKImage
import cc.vv.lkimagecomponent2.lib.mode.ScaleMode

/**
 * 组织生活会adapter
 * Created by Chen.qi on 2018/10/29.
 */
class ZuZhiLifeZKAdapter(layoutResId: Int) : SimpleCommonAdapter<ZhiBuActivitiesBean>(layoutResId) {
    override fun convert(helper: ExtendViewHolder, item: ZhiBuActivitiesBean, position: Int) {

        //图片
        val picPath = item.folder
        LKImage.load().scale(ScaleMode.CENTER_CROP)
                .crossFade(300).placeHolder(R.mipmap.icon_item_pic_zzshh)
                .error(R.mipmap.icon_item_pic_zzshh).load(picPath).into(helper.getView<ImageView>(R.id.iv_ilw_itemPic))

        //名称
        helper.getView<TextView>(R.id.tv_ilw_listTitle)?.text = item.title

        //时间
        helper.getView<TextView>(R.id.tv_ilw_listDataTime)?.text = OperationServer.formatStr(item.activityTime)
    }
}